#ifndef _EXTENDED_TIMING_PARSER_H
#define _EXTENDED_TIMING_PARSER_H

#include <map>
#include <cassert>
#include <limits>
#include <stdio.h>
#include <stdlib.h>
 #include <iostream>
 #include "parser_helper.h"

 struct LibPinTimingInfo {

         string cellInst;
         string pin;
         double riseSlack;
         double fallSlack;
         double riseTransition;
         double fallTransition;

 };

 struct LibPortTimingInfo {

         string port;
         double riseSlack;
         double fallSlack;
         double riseTransition;
         double fallTransition;

 };

 class ExtendedTimingParser:public TimingParser
 {
   public:
         ExtendedTimingParser (std::string fileName) : TimingParser(fileName) {}
         int readTimingFile () ;
         int updateTimingFile(string filename);
        
        std::map<std::string, LibPinTimingInfo> PinsTiming; 
        std::map<std::string, LibPortTimingInfo> PortsTiming; 
        
        bool update_pin_timing (std::ifstream& fi, string& cellInst, string& pin, double& riseSlack, double& fallSlack,
                                double& riseTransition, double& fallTransition) ;
        
        bool update_port_timing (std::ifstream& fi,string& port, double& riseSlack, double& fallSlack,
                                 double& riseTransition, double& fallTransition) ;
        
};

#endif
